const initialState = {
  // 频道
  channels: [],
  ////////////////////////////////////////////文章
  results: [],  // 列表
  // 分页
  page: 1,
  per_page: 10,
  total_count: 0
  // 表单
  // query:{ }
}

const articles = (state=initialState,action)=>{
  if(action.type === 'artciles/setChannel'){
    return {
      ...state,
      channels:action.payload
    }
  }else if(action.type === 'artciles/setArticles'){
    return {
      ...state,
      results:action.payload.results,
      page:action.payload.page,
      per_page:action.payload.per_page,
      total_count:action.payload.total_count
    }
  }
  return state
}

export default articles